import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 会员课程信息 */
export interface VipClasses {
          id: number; // 授课管理主键
          commodityId: string; // 商品ID
          studentQuantity: number; // 报名学生人数
  }

// 会员课程 API
export const VipClassesApi = {
  // 查询会员课程分页
  getVipClassesPage: async (params: any) => {
    return await request.get({ url: `/train/vip-classes/page`, params })
  },

  // 查询全部会员课程
  getVipClassesList: async (params: any) => {
    return await request.get({ url: `/train/vip-classes/list`, params })
  },

  // 查询会员课程详情
  getVipClasses: async (id: number) => {
    return await request.get({ url: `/train/vip-classes/get?id=` + id })
  },

  // 新增会员课程
  createVipClasses: async (data: VipClasses) => {
    return await request.post({ url: `/train/vip-classes/create`, data })
  },

  // 修改会员课程
  updateVipClasses: async (data: VipClasses) => {
    return await request.put({ url: `/train/vip-classes/update`, data })
  },

  // 删除会员课程
  deleteVipClasses: async (id: number) => {
    return await request.delete({ url: `/train/vip-classes/delete?id=` + id })
  },

  /** 批量删除会员课程 */
  deleteVipClassesList: async (ids: number[]) => {
    return await request.delete({ url: `/train/vip-classes/delete-list?ids=${ids.join(',')}` })
  },

  // 导出会员课程 Excel
  exportVipClasses: async (params) => {
    return await request.download({ url: `/train/vip-classes/export-excel`, params })
  }
}
